﻿using Macro_stone.PoModel;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using SystemCenterSoa.IRepository.SystemManager;

namespace SystemCenterSoa.Service.SystemManager
{
    public class DepartmentStaffService
    {
        private IDepartmentStaffRepository _IDepartmentStaffRepository;
        public DepartmentStaffService(IDepartmentStaffRepository IDepartmentStaffRepository)
        {
            _IDepartmentStaffRepository = IDepartmentStaffRepository;
        }

        /// <summary>
        /// 部门—显示
        /// </summary>
        /// <param name="searchModel"></param>
        /// <returns></returns>
        public List<DepartmentPo> DepartmentPoInquire(int pageIndex, int pageSize, string deptName)
        {
            return _IDepartmentStaffRepository.DepartmentPoInquire(pageIndex, pageSize, deptName);
        }

        /// <summary>
        /// 添加部门
        /// </summary>
        /// <param name="view"></param>
        /// <returns></returns>
        public bool DepartmentPoAdd(DepartmentPo view)
        {
            return _IDepartmentStaffRepository.DepartmentPoAdd(view);
        }

        /// <summary>
        /// 部门反填
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public DepartmentPo DepartmentPoOne(int id)
        {
            return _IDepartmentStaffRepository.DepartmentPoOne(id);
        }

        /// <summary>
        /// 部门修改
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public bool DepartmentPoUpdate(DepartmentPo view)
        {
            return _IDepartmentStaffRepository.DepartmentPoUpdate(view);
        }

        /// <summary>
        /// 部门删除
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public bool DepartmentPoDelete(int id)
        {
            return _IDepartmentStaffRepository.DepartmentPoDelete(id);
        }

        /// <summary>
        /// 人员管理—显示
        /// </summary>
        /// <param name="pageIndex"></param>
        /// <param name="pageSize"></param>
        /// <param name="buming"></param>
        /// <param name="name"></param>
        /// <param name="zhuang"></param>
        /// <returns></returns>
        public List<StaffDto> staffPoIndex(int pageIndex, int pageSize, string buming, string name, int? zhuang)
        {
            return _IDepartmentStaffRepository.staffPoIndex(pageIndex, pageSize, buming, name, zhuang);
        }

        /// <summary>
        /// 人员管理—添加
        /// </summary>
        /// <param name="view"></param>
        /// <returns></returns>
        public bool StaffPoAdd(StaffPo view)
        {
            return _IDepartmentStaffRepository.StaffPoAdd(view);
        }

        /// <summary>
        /// 人员管理—删除
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public bool StaffPoDelete(int id)
        {
            return _IDepartmentStaffRepository.StaffPoDelete(id);
        }

        /// <summary>
        /// 部门下拉
        /// </summary>
        /// <returns></returns>
        public List<DepartmentPo> departmentPoXia()
        {
            return _IDepartmentStaffRepository.departmentPoXia();
        }
    }
}
